package com.zilla.android.zillacore.libzilla.util;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import com.github.snowdream.android.util.Log;

/**
 * Created by zilla on 14-7-28.
 */
public class SystemUtil {

    public static Intent getMetaData(Activity activity, String key) {
        ActivityInfo info = null;
        String action = "";
        try {
            info = activity.getPackageManager()
                    .getActivityInfo(activity.getComponentName(),
                            PackageManager.GET_META_DATA);
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(e.getMessage());
        }
        Intent intent = new Intent();
        action = info.metaData.getString(key);
        intent.setAction(action);
        return intent;
    }
}
